package com.liuhouse.strame;

public class MethodDemo {

    //定义一个接口
    interface UseString{
        //定义一个抽象方法
        String use(String str , int start , int length);
    }

    public static String subAuthorName(String str , UseString useString){
        int start = 0;
        int length = 1;
        return useString.use(str , start , length);
    }

    public static void main(String[] args) {
        //原来静态方法就是这样定义和使用的
        String s = subAuthorName("三更半夜", String::substring);
        System.out.println(s);
    }

}
